priority -50

# react

snippet reactft
/* vim: set filetype=javascript.jsx */
endsnippet

snippet span
<span${1: className="${2}"}>$0</span>
endsnippet

snippet div
<div${1: className="${2}"}>$0</div>
endsnippet

snippet p
<p${1: className="${2}"}>$0</p>
endsnippet

snippet h1
<h1${1: className="${2}"}>$0</h1>
endsnippet

snippet h2
<h2${1: className="${2}"}>$0</h2>
endsnippet

snippet h3
<h3${1: className="${2}"}>$0</h3>
endsnippet

snippet h4
<h4${1: className="${2}"}>$0</h4>
endsnippet

snippet h5 
<h5${1: className="${2}"}>$0</h5>
endsnippet

snippet a
<a href="${1:javascript:}"${2: class="${3}"}>$0</a>
endsnippet

snippet hjs
href="javascript:"
endsnippet

snippet ifa
<i className="fa fa-${1} fa-2x"></i>
endsnippet

## antd

snippet Row
<Row${1: styleName="${2}"}>
	$0
</Row>
endsnippet

snippet	Col
<Col span="$1" offset="$2">
	$0
</Col>
endsnippet

snippet	cn
className="$0"
endsnippet

snippet	sn
styleName="$0"
endsnippet


## react
snippet cdm "component did mount" b
componentDidMount() {
	${1}
}$0
endsnippet

snippet cdup "component did update" b
componentDidUpdate(prevProps, prevState) {
	${1}
}$0
endsnippet

snippet cwm "component will mount" b
componentWillMount() {
	${1}
}$0
endsnippet

snippet cwr "component will receive props" b
componentWillReceiveProps(nextProps) {
	${1}
}$0
endsnippet

snippet cwun "component will unmount" b
componentWillUnmount() {
	${1}
}$0
endsnippet

snippet cwu "component will update" b
componentWillUpdate(nextProps, nextState) {
	${1}
}$0
endsnippet

snippet cx
cx({
	${1}: ${2}
})
endsnippet

snippet fup
forceUpdate(${1:callback})
endsnippet

snippet gdp "get default props" b
getDefaultProps() {
	return {
		${1}

	}
}$0
endsnippet

snippet gis "get initial state" b
getInitialState() {
	return {
		${1}: ${2}
	}
}$0
endsnippet

snippet ism "is mounted"
isMounted()
endsnippet

snippet jsx "define jsx dom" b
/**
 * @jsx React.DOM
 */

var React = require('react')
}
var ${2:ClassName} = React.createClass({

render: function() {
	return (
		${VISUAL}$4
	)
}

})
$0
${3:module.exports = $2}
endsnippet

snippet rcs "create class" b
const ${2:ClassName} = React.createClass({
	render: function() {
		return (
			${VISUAL}$0
		)
	}
})
endsnippet

snippet rcc "create component" b
class $0 extends Component {
	render() {
		return (
			$1
		)
	}
}
endsnippet


snippet ril "inline react"
{(() => {
	$0
})()}
endsnippet



snippet pt "propTypes" b
static propTypes = {
	${1}: React.PropTypes.${2:string}
}
endsnippet

snippet rcc "create class/component" b
var ${1:ClassName} = React.createClass({

render: function() {
	return (
		${VISUAL}$2
	)
}

})
$0
endsnippet

snippet ren
render() {
	return (
		${1:<div />}
	)
}$0
endsnippet

snippet sst "set state" b
this.setState({
	${1}: ${2}
})$0
endsnippet

snippet constr
constructor(props) {
  super(props)
}
endsnippet

snippet scu "should component update"
shouldComponentUpdate(nextProps, nextState) {
	${1}
}$0
endsnippet

snippet props "get property" i
this.props.${1}
endsnippet

snippet state "get state" i
this.state.${1}
endsnippet

snippet trp
this.transferPropsTo(${VISUAL}$0)
endsnippet

# angualr
snippet	ngc
/* @ngInject */
function $0($timeout, $http, serv, $scope, toaster) {

}
endsnippet


snippet date
${2:${1:`date +%d`}.`date +%m`}.`date +%Y`
endsnippet

snippet s123
`#!/usr/bin/env node
console.log('123')`
endsnippet

snippet f
function $1(${2}) {
	$3
}
endsnippet

snippet proto
$1.prototype.$2 = function($3) {
	$4
}
endsnippet

snippet clo
console.log($1)
endsnippet

snippet edl
// eslint-disable-line
endsnippet

snippet rvim
/* vim:set ft=javascript.jsx : */
endsnippet


